feat: embeddable calculator widgets with postMessage resize (issue #121) - #170
yy1142274323 wants to merge 1 commit into
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
@yy1142274323 is attempting to deploy a commit to the milieninyv's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
/claim #121 |
|
😅 Ups... the issue does not have any reward yet! |
|
Thank you for this, @yy1142274323 — the embed routes, the Your commit is merged into #174 unchanged (
Closing this PR in favour of #174 so the review happens in one place. Thanks again for the contribution. |
Embeddable calculator widgets (supersedes #170)
Bounty #121 — Embeddable calculator widgets for external sites
Closes #121
Acceptance criteria
/embed/blind-flange-calculator/and/embed/pressure-vessel-dished-end-calc/build/embed/*/index.htmlboth generated)postMessage-based resize handling; no third-party cookies requiredEmbedUtilityPagemeasures the same-origin tool iframe content height, sizes the frame to it, and posts{source: 'cadautoscript-embed', type: 'resize', height, slug}to the embedding parentdocs/utilities/embed-calculators.mdrewritten: embed URL table, copy-paste iframe + parent-side resize-listener snippet for both calculators, how-it-works sectionImplementation notes
src/components/Utilities/EmbedUtilityPage.tsx(minimal chrome: no navbar/footer, just the tool iframe + powered-by bar)src/pages/embed/<slug>.tsx(3 lines each, factory pattern — easy to extend to other calculators)utilityPageConfigs(appPath,title,iframeAllow), so embed behavior stays in sync with the full shell pages<meta name="robots" content="noindex">to protect search visibility of the main pagespnpm buildpasses; embed routes present in the generated static outputExtending to more calculators